using System.Collections.Generic;

namespace InfoCenter.Agent.Entities
{
    public class Process
    {
        #region private fields
        private int _pid;
        private string _name;
        #endregion

        #region public properties
        public int Pid
        {
            get { return _pid; }
            set { _pid = value; }
        }

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        #endregion

        public static IList<Process> Processes()
        {
            IList<Process> processes = new List<Process>();
            foreach (System.Diagnostics.Process process in System.Diagnostics.Process.GetProcesses())
            {
                Process p = new Process();
                p.Pid = process.Id;
                p.Name = process.ProcessName;

                processes.Add(p);
            }
            return processes;
        }


    }
}
